From 04eb875e86094e6ca6909d86cb3a867b66110b24 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Tue, 23 Nov 2010 12:47:16 +0100 Subject: [PATCH] open-with-diaolog: set the default text according to the dialog mode --- gtk/gtkopenwithdialog.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gtk/gtkopenwithdialog.c b/gtk/gtkopenwithdialog.c index fd0aca9e0d..1b66152bc0 100644 --- a/gtk/gtkopenwithdialog.c +++ b/gtk/gtkopenwithdialog.c @@ -224,7 +224,7 @@ get_extension (const char *basename) static void set_dialog_properties (GtkOpenWithDialog *self) { - char *label, *name, *extension, *description; + char *label, *name, *extension, *description, *default_text, *string; PangoFontDescription *font_desc; name = NULL; @@ -245,6 +245,8 @@ set_dialog_properties (GtkOpenWithDialog *self) { /* Translators: %s is a filename */ label = g_strdup_printf (_("Select an application to open \"%s\""), name); + string = g_strdup_printf (_("No applications available to open \"%s\""), + name); } else { @@ -252,6 +254,9 @@ set_dialog_properties (GtkOpenWithDialog *self) label = g_strdup_printf (_("Select an application for \"%s\" files"), g_content_type_is_unknown (self->priv->content_type) ? self->priv->content_type : description); + string = g_strdup_printf (_("No applications available to open \"%s\" files"), + g_content_type_is_unknown (self->priv->content_type) ? + self->priv->content_type : description); } font_desc = pango_font_description_new (); @@ -261,10 +266,20 @@ set_dialog_properties (GtkOpenWithDialog *self) gtk_label_set_markup (GTK_LABEL (self->priv->label), label); + default_text = g_strdup_printf ("%s\n%s", + string, + _("Click \"Show other applications\", for more options, or " + "\"Find applications online\" to install a new application")); + + gtk_open_with_widget_set_default_text (GTK_OPEN_WITH_WIDGET (self->priv->open_with_widget), + default_text); + g_free (label); g_free (name); g_free (extension); g_free (description); + g_free (string); + g_free (default_text); } static void -- 2.30.2